﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Web.Mvc.Ajax;
using Hotnet.Entity;
using Hotnet.Biz.NSBizCommon;

namespace Hotnet.Web.Controllers.Admin
{
	public class AdminSourceFromController : AdminBaseController
	{
		private BizSourceFrom bizSourceFrom;
		public AdminSourceFromController(BizSourceFrom bizSourceFrom)
		{
			this.bizSourceFrom = bizSourceFrom;
		}

		public ActionResult Index()
		{
			return View(bizSourceFrom.List());
		}

		[AcceptVerbs(HttpVerbs.Post)]
		public ActionResult Create(SourceFrom sourceFrom)
		{
			bizSourceFrom.Insert(sourceFrom);
			return RedirectToAction("Index");
		}

		[AcceptVerbs(HttpVerbs.Post)]
		public ActionResult Edit(SourceFrom sourceFrom)
		{
			bizSourceFrom.Update(sourceFrom);
			return RedirectToAction("Index");
		}

		[AcceptVerbs(HttpVerbs.Post)]
		public ActionResult Delete(int? id)
		{
			bizSourceFrom.Delete(id ?? 0);
			return RedirectToAction("Index");
		}

	}
}
